#ifndef __THRDPOOL_H
#define __THRDPOOL_H

#define R_EVENT 0
#define W_EVENT 1
typedef struct thrdqueue_t Queue;
typedef struct thrdpool_t  Thrd;

typedef struct {
    void* ctx;
    int   event; //未启用
    void (*handle)(void* ctx, int event);
} Task;

Thrd* thrdpool_init(int thrdnums);

int thrdpool_add(Thrd* pool, Task* task);

void thrdpool_destory(Thrd* pool);

#endif